package org.msn.client;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import lombok.extern.slf4j.Slf4j;
import org.msn.client.handler.ClientHandler;
import org.msn.client.support.DefaultClientBoot;
import org.msn.codec.MsgpackDecoder;
import org.msn.codec.MsgpackEncoder;
import org.msn.util.YamlUtil;

import java.io.FileNotFoundException;
import java.util.Map;

@Slf4j
public class Boot2 {
    public static void main(String[] args) throws InterruptedException, FileNotFoundException {
        Map<String, Object> map = YamlUtil.read("client");
        ClientBoot boot = new DefaultClientBoot();

        boot.run((String) map.get("ip"), (int) map.get("port"));
    }
}
